class Student():

    #_score代表私有属性
    _score = 0
    config = ''

    def __init__(self):
        pass

    def __privates(self):
        self.config = 'val'
    
    @property
    def score(self):
        return self._score
    
    @score.setter
    def score(self, value):
        if not isinstance(value, int):
            raise ValueError('score must be an integer!')
        if value < 0 or value > 100:
            raise ValueError('score must between 0 ~ 100!')
        self._score = value


s = Student()
s.score = 60
print('s.score =', s._score)
# ValueError: score must between 0 ~ 100!
#s.score = 9999